import {
  getImage
} from "../service/api_image"

// 获取图片
export default function getSomeImage(count = 1) {
  const imgRule = /\/\/(\S*)jpg/
  return new Promise(resolve => {
    const promiseArr = []
    for (let i = 0; i < count; i++) {
      promiseArr.push(getImage())
    }
    Promise.all(promiseArr).then(res => {
      const imgUrlArr = res.map(item => {
        return "http:" + imgRule.exec(item.data)[0]
      })
      resolve(imgUrlArr)
    })
  })
}


